import java.util.HashMap;

class Solution {
    public int subarraysDivByK(int[] nums, int k) {
        HashMap<Integer,Integer> hash=new HashMap<>();
        hash.put(0,1);
        int count=0,sum=0,n=nums.length,num=0;

        for(int i=0;i<n;i++){
            sum+=nums[i];
            num=(sum%k+k)%k;

            count+= hash.getOrDefault(num,0);
            hash.put(num,hash.getOrDefault(num,0)+1);

        }

        return count;

    }

    public static void main(String[] args) {
        int n=-8%3;
        System.out.println(n);
    }


}